Preview - Constructing A Simple Model: Solid Diffusion

Choose agent behaviors, time step and pseudo-code of go procedure


One way to implement the pseudo-code for the setup procedure in the previous section is in the model below. Compare it with yours, and make any changes you want. The choice to make the atoms square is purely aesthetic to match the square lattice. If you prefer circles or another shape that's fine. Compare this setup procedure to yours and make any changes you want. Then continue below to choose agent behaviors and write pseudo-code for the go procedure. If you are unfamiliar with any of the commands in the setup procedure, look them up in the Programming Guide.


Questions

Please answer the questions below.

The next step is to choose agent behaviors. In the Fire model the agent behaviors are:

  • ignite: fires light neighboring unburnt trees on fire
  • fade-embers: fires burn out

What should the agent behaviors in the diffusion model be? Answer in the box below. 

(the Fire model is here for reference)


Designing a time step

Now we will design a time step. This just mean writing down everything that happens each tick. This can be written as pseudo-code for a go procedure. For the fire model, this could be written as:

At each tick:

  • If I'm a fire I light neighboring trees on fire and then turn to an ember
  • If I'm an ember, I fade

Writing the behaviors at each tick from the perspective agents can make it easier to reason about, but you can use whatever phrasing makes the most sense to you.

Try writing pseudo-code for what should happen at each tick in the diffusion model.


If you had any issues on this page, describe them below. If not, type something like "no problems" and continue on.


Notes

These notes will appear on every page in this lesson so feel free to put anything here you'd like to keep track of.